package com.jean.com.retrofittest;

import com.jean.com.retrofittest.sercive.ApiException;

import rx.functions.Func1;

/**
 * Created by jean on 2016/5/11.
 */
public class HttpResultFun<T> implements Func1<HttpResult<T>,T> {
        @Override
        public T call(HttpResult<T> tHttpResult) {
            if(tHttpResult.getStatus()!=200){
                throw  new ApiException(tHttpResult.getStatus());
            }
            return tHttpResult.getData();
        }
    }

